Optimal. Leaf size=72 \[ a^2 d \cos (c) \text{CosIntegral}(d x)-a^2 d \sin (c) \text{Si}(d x)-\frac{a^2 \sin (c+d x)}{x}+2 a b \sin (c) \text{CosIntegral}(d x)+2 a b \cos (c) \text{Si}(d x)-\frac{b^2 \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.242429, antiderivative size = 72, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 6, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.353, Rules used = {6742, 2638, 3297, 3303, 3299, 3302} \[ a^2 d \cos (c) \text{CosIntegral}(d x)-a^2 d \sin (c) \text{Si}(d x)-\frac{a^2 \sin (c+d x)}{x}+2 a b \sin (c) \text{CosIntegral}(d x)+2 a b \cos (c) \text{Si}(d x)-\frac{b^2 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 2638
Rule 3297
Rule 3303
Rule 3299
Rule 3302
Rubi steps
\begin{align*} \int \frac{(a+b x)^2 \sin (c+d x)}{x^2} \, dx &=\int \left (b^2 \sin (c+d x)+\frac{a^2 \sin (c+d x)}{x^2}+\frac{2 a b \sin (c+d x)}{x}\right ) \, dx\\ &=a^2 \int \frac{\sin (c+d x)}{x^2} \, dx+(2 a b) \int \frac{\sin (c+d x)}{x} \, dx+b^2 \int \sin (c+d x) \, dx\\ &=-\frac{b^2 \cos (c+d x)}{d}-\frac{a^2 \sin (c+d x)}{x}+\left (a^2 d\right ) \int \frac{\cos (c+d x)}{x} \, dx+(2 a b \cos (c)) \int \frac{\sin (d x)}{x} \, dx+(2 a b \sin (c)) \int \frac{\cos (d x)}{x} \, dx\\ &=-\frac{b^2 \cos (c+d x)}{d}+2 a b \text{Ci}(d x) \sin (c)-\frac{a^2 \sin (c+d x)}{x}+2 a b \cos (c) \text{Si}(d x)+\left (a^2 d \cos (c)\right ) \int \frac{\cos (d x)}{x} \, dx-\left (a^2 d \sin (c)\right ) \int \frac{\sin (d x)}{x} \, dx\\ &=-\frac{b^2 \cos (c+d x)}{d}+a^2 d \cos (c) \text{Ci}(d x)+2 a b \text{Ci}(d x) \sin (c)-\frac{a^2 \sin (c+d x)}{x}+2 a b \cos (c) \text{Si}(d x)-a^2 d \sin (c) \text{Si}(d x)\\ \end{align*}
Mathematica [A] time = 0.253961, size = 64, normalized size = 0.89 \[ -\frac{a^2 \sin (c+d x)}{x}+a \text{CosIntegral}(d x) (a d \cos (c)+2 b \sin (c))-a \text{Si}(d x) (a d \sin (c)-2 b \cos (c))-\frac{b^2 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.019, size = 74, normalized size = 1. \begin{align*} d \left ( -{\frac{{b}^{2}\cos \left ( dx+c \right ) }{{d}^{2}}}+2\,{\frac{ab \left ({\it Si} \left ( dx \right ) \cos \left ( c \right ) +{\it Ci} \left ( dx \right ) \sin \left ( c \right ) \right ) }{d}}+{a}^{2} \left ( -{\frac{\sin \left ( dx+c \right ) }{dx}}-{\it Si} \left ( dx \right ) \sin \left ( c \right ) +{\it Ci} \left ( dx \right ) \cos \left ( c \right ) \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] time = 3.28563, size = 166, normalized size = 2.31 \begin{align*} \frac{{\left ({\left (a^{2}{\left (\Gamma \left (-1, i \, d x\right ) + \Gamma \left (-1, -i \, d x\right )\right )} \cos \left (c\right ) - a^{2}{\left (i \, \Gamma \left (-1, i \, d x\right ) - i \, \Gamma \left (-1, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{2} -{\left (a b{\left (-2 i \, \Gamma \left (-1, i \, d x\right ) + 2 i \, \Gamma \left (-1, -i \, d x\right )\right )} \cos \left (c\right ) - 2 \, a b{\left (\Gamma \left (-1, i \, d x\right ) + \Gamma \left (-1, -i \, d x\right )\right )} \sin \left (c\right )\right )} d\right )} x - 2 \,{\left (b^{2} x + 2 \, a b\right )} \cos \left (d x + c\right )}{2 \, d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.76644, size = 346, normalized size = 4.81 \begin{align*} -\frac{2 \, b^{2} x \cos \left (d x + c\right ) + 2 \, a^{2} d \sin \left (d x + c\right ) -{\left (a^{2} d^{2} x \operatorname{Ci}\left (d x\right ) + a^{2} d^{2} x \operatorname{Ci}\left (-d x\right ) + 4 \, a b d x \operatorname{Si}\left (d x\right )\right )} \cos \left (c\right ) + 2 \,{\left (a^{2} d^{2} x \operatorname{Si}\left (d x\right ) - a b d x \operatorname{Ci}\left (d x\right ) - a b d x \operatorname{Ci}\left (-d x\right )\right )} \sin \left (c\right )}{2 \, d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b x\right )^{2} \sin{\left (c + d x \right )}}{x^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]